package AlgorithmDesign;
import java.util.Scanner;
public class PerfectCube {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入1-9999之间的数字：");
        int n=sc.nextInt();//n以内的所有完美立方数
        for(int a=2;a<n;a++){
            for(int b=2;b<a;b++){
                for(int c=b;c<a;c++){
                    for(int d=c;d<a;d++){
                        if(a*a*a==b*b*b+c*c*c+d*d*d){
                            System.out.println("Cube="+a+" "+"Triple="+b+","+c+","+d);
                        }
                    }
                }
            }
        }
    }
}
